<?php
/**
 * @package    com.promobico.mcm
 * @subpackage mvm
 * @link promobico.com
 * @license  All rights reserved.
 */
 
// no direct access
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
jimport( 'joomla.application.component.view');
 
/**
 * HTML View class for the MvmView Component
 *
 * @package    mvm
 */
 
class MvmViewproduct extends JView
{
    function display($tpl = null)
    {
		$show_prices  = _SHOW_PRICES;
		if($show_prices == '1'){
			JLoader::import('helpers.calculationh', JPATH_COMPONENT);
		}
		$this->assignRef('show_prices', $show_prices);


		$task = JRequest::getCmd('task');

		/* Set the helper path */
		$this->addHelperPath(JPATH_COMPONENT.'helpers');


		/* Load the product */
		$product_model = $this->getModel('product');

		$product_idArray = JRequest::getVar('product_id');
		if(is_array($product_idArray)){
			$product_id=$product_idArray[0];
		} else {
			$product_id=$product_idArray;
		}

		$product = $product_model->getProduct($product_id);

		if(empty($product->product_id)){
			return;
		}
		$this->assignRef('product', $product);

		/* Load the category */
		$category_model = $this->getModel('category');

		/* Load the reviews */
		if (_PSHOP_ALLOW_REVIEWS == '1') {
			$model = $this->getModel();
			/* Show all reviews available */
			$product_reviews = $model->getProductReviews($product->product_id);
			$this->assignRef('product_reviews', $product_reviews);
		}
	    JLoader::import('helpers.mvmuri',JPATH_COMPONENT);
		
   	
        parent::display($tpl);
    }
}